﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="KAICAIJHXD.aspx.cs" Inherits="Web.Pages.QuShui.DiXiaS._3.JiHuaGL.KaiCaiJH.KAICAIJHXD" Theme="Default" %>
<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>开采计划下达</title>
    <script src="../../../../../JS/jquery.js"></script>
    <script type="text/javascript">
        function XiaDaJH() {
            if (txtYear.GetText() != "") {
                ASPxCallback1.PerformCallback("yz1");
            } else {
                alert("下达计划的年份不能为空！");
            }
        }

        function ASPxCallback1Complete(rs) {
            var arr = rs.split('|');
            var type = arr[0];
            var state = arr[1];
            if (type == "yz1") {
                if (arr[2] == "true") {
                    ASPxCallback1.PerformCallback("yz2");
                } else {
                    alert("该年度尚未制定计划，请先核对!");
                }
            } else if (type == "yz2") {
                if (arr[2] == "true") {
                    if (confirm("确认要下达采灌计划吗")) {
                        ASPxCallback1.PerformCallback("xdjh");
                    }
                } else {
                    alert("尚有用户未制定计划，请先核对!");
                }
            } else if (type == "xdjh") {
                if (arr[2] == "1") {
                    alert("计划成功下达！");
                } else {
                    alert("计划下达失败！");
                }
            }
        }
    </script>
</head>
<body>
<form id="form1" runat="server">
    <dx:ASPxCallback ID="ASPxCallback1" ClientInstanceName="ASPxCallback1" runat="server" OnCallback="ASPxCallback1_Callback" ClientSideEvents-CallbackComplete="function(s,e){ASPxCallback1Complete(e.result);}"></dx:ASPxCallback>
    <div class="tabletitle1" align="center">
        开采计划下达
    </div>
    <div style="height: 50px; padding-top: 30px" align="center">
        <table id="Info">
            <tr class="tr-style">
                <td class="td-1">年份：</td>
                <td class="td-2">
                    <dx:ASPxTextBox ID="txtYear" ClientInstanceName="txtYear" runat="server" MaxLength="4" Width="100" ClientEnabled="false">
                    </dx:ASPxTextBox>
                </td>
            </tr>
        </table>

    </div>
    <div align="center">
        <table id="GridViewButtonTable" runat="server">
            <tr>
                <td style="text-align: center;">
                    <dx:ASPxButton ID="btnXD" ClientInstanceName="btnXD" runat="server" Text="下达" AutoPostBack="false" UseSubmitBehavior="false">
                        <ClientSideEvents Click="function(s,e){XiaDaJH();}"/>
                    </dx:ASPxButton>
                </td>
            </tr>
        </table>
    </div>
</form>
</body>
</html>